package top.itpath.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Getter;
import lombok.Setter;
import top.itpath.common.BaseModel;
import top.itpath.common.TreeEntity;

import javax.persistence.Entity;
import javax.persistence.Transient;
import java.util.List;

/**
 * 菜单
 *
 * @author zhaomengru
 * create by  2023/10/11 - 13:36
 */
@Getter
@Setter
@Entity
public class SysMenu extends BaseModel implements TreeEntity<SysMenu> {

    private String name;

    private String permission;

    private String icon;


    private Long parentId;

    /**
     * 菜单类型
     * {@link MenuType}
     */
    private Integer type;

    @Transient
    @TableField(exist = false)
    private List<SysMenu> children;

    /**
     * 菜单类型
     */
    public static class MenuType {
        public static final int MENU = 0;
        public static final int BUTTON = 1;
    }
}
